package com.ald.crossex.dto;

import java.util.Date;

/**
 * Created by lishijiong on 15/3/10.
 */
public class SendOrderDto {

    private String name;
    private String receiver;
    private Date pickupTime;
    private String start;
    private String end;
    private String sender;
    private Integer uid;
    private Integer gid;
    private Integer oid;
    private Integer status;
    private String statusStr;
    private Date endTime;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getReceiver() {
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    public Date getPickupTime() {
        return pickupTime;
    }

    public void setPickupTime(Date pickupTime) {
        this.pickupTime = pickupTime;
    }

    public String getStart() {
        return start;
    }

    public void setStart(String start) {
        this.start = start;
    }

    public String getEnd() {
        return end;
    }

    public void setEnd(String end) {
        this.end = end;
    }

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public Integer getGid() {
        return gid;
    }

    public void setGid(Integer gid) {
        this.gid = gid;
    }

    public Integer getOid() {
        return oid;
    }

    public void setOid(Integer oid) {
        this.oid = oid;
    }

    public Integer getStatus() {

        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getStatusStr() {
        return OrderStatus.getStatusMsg(this.status);
    }

    public void setStatusStr(String statusStr) {
        this.statusStr = OrderStatus.getStatusMsg(this.status);
    }

    enum OrderStatus {

        //订单状态：0已接订单（新生成订单），1快递人已联系用户，2快递人已取货，3已配送完成（确认收货）
        NEW(0, "未接"), CONTACT(1, "已接订单"), PICKUP(2, "已取货"), COMPLETE(3, "已完成");


        private Integer status;
        private String msg;

        OrderStatus(Integer status, String msg) {
            this.msg = msg;
            this.status = status;
        }

        public static String getStatusMsg(Integer status) {
            for (OrderStatus s : OrderStatus.values()) {
                if (s.getStatus().intValue() == status.intValue()) {
                    return s.getMsg();
                }
            }
            return "";
        }

        public String getMsg() {
            return msg;
        }

        public void setMsg(String msg) {
            this.msg = msg;
        }

        public Integer getStatus() {
            return status;
        }

        public void setStatus(Integer status) {
            this.status = status;
        }
    }

}
